package com.zqcy.workbench.utils;

import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.zqcy.workbench.R;


public class ShareDialog extends Dialog {
    Context con;

    public ShareDialog(Context context) {
        super(context, R.style.dialog);
        this.con = context;
        initView();
        Window window = getWindow();
        window.setWindowAnimations(R.style.dialog_bottom_animation);
        window.setBackgroundDrawableResource(android.R.color.transparent);
        WindowManager.LayoutParams params = window.getAttributes();
        if (params != null) {
            params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
            params.width = ViewGroup.LayoutParams.MATCH_PARENT;
            params.gravity = Gravity.BOTTOM;//设置dialog 在布局中的位置
        }
        window.setAttributes(params);
    }


    public RelativeLayout tvWxShare;  //微信分享
    public RelativeLayout tvQqShare;  //qq分享
    public RelativeLayout tvQqShareImage; //qq分享(图片)
    public RelativeLayout tvWBShare;  //微博分享(链接)
    public TextView tvCancel; //取消

    private void initView() {
        setContentView(R.layout.dialog_share);
        tvWxShare = findViewById(R.id.tv_WxShare);
        tvQqShare = findViewById(R.id.tv_QqShare);
        tvQqShareImage = findViewById(R.id.tv_QqShareImage);
        tvCancel = findViewById(R.id.tv_cancel);
        tvWBShare = findViewById(R.id.tv_WBShare);
    }
}
